package com.cainiao.dao;

import com.cainiao.bean.Employees;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author shkstart
 * @create 2021-04-02 23:55
 */
public interface EmployeeMapperDao {
    //多条记录封装一个map：Map<Integer,employees>:键是这条记录的主键，值时记录封装后的JavaBean
    @MapKey("id") //告诉mybatis，封装这个map的时候用哪个属性当作key
    public Map<Integer, Employees> getEmpByLastNameMap(String lastName);

    //返回一条记录的map:key就是列名，值就是对应的值。
    public Map<String, Object> getEmpByIdReturnMap(Integer id);

    //返回集合
    public List<Employees> getEmpByLastName(String lastName);

    public Employees getEmpMap(Map<String, Object> map);

    //传递多个参数 根据id和lastName查询员工
    public Employees getEmpByIdAdnLastName(@Param("id") Integer id, @Param("lastName") String lastName);

    public Employees getEmpById(Integer id);

    public Integer addEmp(Employees emp);

    public void updateEmp(Employees emp);

    public void deleteEmp(Integer id);
}
